<template>
    <div id="comb_view">
        <div id="game_220" class="game_view">
            <table class="u-table2">
                <thead>
                <tr>
                    <th style="width: 4%;">特肖</th>
                    <th style="width: 20%;">号</th>
                    <th style="width: 8%;">赔率</th>
                    <th style="width: 8%;">金额</th>
                    <th style="width: 4%;">生肖</th>
                    <th style="width: 20%;">号</th>
                    <th style="width: 8%;">赔率</th>
                    <th style="width: 8%;">金额</th>
                </tr>
                </thead>
                <tbody>
                <TrItem :key="i" v-for="(row,i) in list[0]" :row="row" :bet-number="betNumber" ></TrItem>
                </tbody>
            </table>
        </div>
    </div>
</template>

<script>
    import TrItem from "../components/TrItem";
    import {mapState} from "vuex";

    export default {
        name: 'ZhengXiao',
        components: {
            TrItem
        },
        data() {
            return {
                list: [
                    [
                        [
                            {id:24842,name:'鼠',bet:1.92,
                                number:['01','13','25','37','49'],
                                selected:false,hovering:false,amount:''},
                            {id:24841,name:'马',bet:1.76,
                                number:['07','19','31','43'],
                                selected:false,hovering:false,amount:''},
                        ],
                        [
                            {id:24843,name:'牛',bet:1.92,
                                number:['01','13','25','37','49'],
                                selected:false,hovering:false,amount:''},
                            {id:24844,name:'羊',bet:1.92,
                                number:['07','19','31','43'],
                                selected:false,hovering:false,amount:''},
                        ],
                        [
                            {id:24843,name:'兔',bet:1.92,
                                number:['01','13','25','37','49'],
                                selected:false,hovering:false,amount:''},
                            {id:24844,name:'鸡',bet:1.92,
                                number:['07','19','31','43'],
                                selected:false,hovering:false,amount:''},
                        ],
                        [
                            {id:24843,name:'虎',bet:1.76,
                                number:['01','13','25','37','49'],
                                selected:false,hovering:false,amount:''},
                            {id:24844,name:'猴',bet:1.76,
                                number:['07','19','31','43'],
                                selected:false,hovering:false,amount:''},
                        ],
                        [
                            {id:24843,name:'龙',bet:1.76,
                                number:['01','13','25','37','49'],
                                selected:false,hovering:false,amount:''},
                            {id:24844,name:'狗',bet:1.76,
                                number:['07','19','31','43'],
                                selected:false,hovering:false,amount:''},
                        ],
                        [
                            {id:24843,name:'蛇',bet:1.76,
                                number:['01','13','25','37','49'],
                                selected:false,hovering:false,amount:''},
                            {id:24844,name:'猪',bet:1.76,
                                number:['07','19','31','43'],
                                selected:false,hovering:false,amount:''},
                        ],
                    ]
                ]
            }
        },
        computed:{
            ...mapState(['betNumber'])
        },
        watch:{
            betNumber(nVal){
                this.list.forEach((arr)=>{
                    arr.forEach((item)=>{
                        item.forEach((o)=>{
                            if (o.selected) {
                                o.amount = nVal
                            }
                        })
                    })
                })
                this.$forceUpdate()
            }
        },
        methods: {

        }
    }
</script>

<style scoped>

</style>